import request from '@/router/axios';




//项目开发任务书
//项目开发任务书列表
export const getTaskList = (params) => {
  return request({
    url: '/api/hg-public/protaskbook/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}
//新增项目开发任务书
export const addTask = (row) => {
  return request({
    url: '/api/hg-public/protaskbook/save',
    method: 'post',
    data: row
  })
}

//删除项目开发任务书
export const removeTask = (ids) => {
  return request({
    url: '/api/hg-public/protaskbook/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

//更新项目开发任务书
export const updateTask = (row) => {
  return request({
    url: '/api/hg-public/protaskbook/update',
    method: 'post',
    data: row
  })
}

//获取项目开发任务书详情
export const getTask = (id) => {
  return request({
    url: '/api/hg-public/protaskbook/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
// 产品开发任务书  提交审批
export const projectProdDevSubmit = (proTaskBookId) => {
  return request({
    url: '/api/hg-public/protaskbook/start-process',
    method: 'get',
    params: {
      proTaskBookId,
    }
  })
}
//获取总目标详情
export const getTotalGoals = (taskBookId) => {
  return request({
    url: '/api/hg-public/taskbookmaintarget/list',
    method: 'get',
    params: {
      taskBookId,
    }
  })
}

//保存总目标
export const saveTotalGoals = (row) => {
  return request({
    url: '/api/hg-public/taskbookmaintarget/batchSave',
    method: 'post',
    data: row
  })
}


//获取阶段目标详情
export const getStageGoals = (taskBookId, projectType) => {
  return request({
    url: '/api/hg-public/taskbookphasestarget/list',
    method: 'get',
    params: {
      taskBookId,
      projectType
    }
  })
}

//保存阶段目标
export const saveStageGoals = (row) => {
  return request({
    url: '/api/hg-public/taskbookphasestarget/batchSave',
    method: 'post',
    data: row
  })
}


//获取开发任务详情
export const getTasks = (taskBookId) => {
  return request({
    url: '/api/hg-public/taskbooktask/list',
    method: 'get',
    params: {
      taskBookId,
    }
  })
}

//保存开发任务
export const saveTasks = (row) => {
  return request({
    url: '/api/hg-public/taskbooktask/batchSave',
    method: 'post',
    data: row
  })
}


//获取重要时间节点详情
export const getTimeNodes = (custPrdDemandId) => {
  return request({
    url: '/api/hg-public/custprddemandinfo/timenodes',
    method: 'get',
    params: {
      custPrdDemandId,
    }
  })
}

//获取产品要求详情
export const getProductRequire = (proId) => {
  return request({
    url: '/api/hg-public/custprddemandinfo/requirements',
    method: 'get',
    params: {
      proId,
    }
  })
}

